#include <func.h>

int main()
{
    pid_t pid;
    pid=fork();
    if(0==pid)
    {
        printf("i am child,pid=%d,ppid=%d\n",getpid(),getppid());
        exit(3);
    }else{
        printf("i am parent,,mychildpid=%d,pid=%d,ppid=%d\n",pid,getpid(),getppid());
        int status;
        pid=wait(&status);
        if(WIFEXITED(status))
        {
                printf("childe exit code=%d\n",WEXITSTATUS(status));
        }else{
            printf("child dead\n");
        }
        printf("wait pid = %d\n",pid);
        return 0;
    }
}